package com.beici.waterghost.service.impl;

import com.beici.waterghost.mapper.commentsMapper;
import com.beici.waterghost.model.comments;
import com.beici.waterghost.model.resultes;
import com.beici.waterghost.service.commentService;
import com.beici.waterghost.utils.takeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @auther WaterGhost
 * @date 2022/1/28 18:30
 */
@Service
public class commentServiceImpl implements commentService {

    @Autowired
    private commentsMapper commentsServer;

    @Override
    public resultes saveComment(Integer userId, String Context, String ip, Long nodeId) {
        comments comment = new comments(nodeId,userId,new Date(),ip,Context,1,null);
        takeUtils.vefitiyINSERT(commentsServer.insert(comment));
        return resultes.success("发布成功",true);
    }
}
